#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void move (char pos1,char pos2)
{
     printf(" %c->%c ",pos1,pos2);
}
void Hanoi (int n,char pos1,char pos2,char pos3)
{
     if(n==1)
	 {
	     move(pos1,pos3);
	 }
	 else
	 {
	     Hanoi(n-1,pos1,pos3,pos2);
		 move(pos1,pos3);
		 Hanoi(n-1,pos2,pos1,pos3);
	 }
}
int main ()
{
     Hanoi(1,'a','b','c');
	 printf("\n");
	 Hanoi(2,'a','b','c');
	 printf("\n");
	 Hanoi(3,'a','b','c');
	 printf("\n");
	 return 0;
}